import request from '@/utils/request'

//得到分类商品请求
export const reqCategory1list = () => request({ url: `/admin/product/getCategory1`, method: 'get' })
export const reqCategory2list = (category1Id) => request({ url: `/admin/product/getCategory2/${category1Id}`, method: 'get' })
export const reqCategory3list = (category2Id) => request({ url: `/admin/product/getCategory3/${category2Id}`, method: 'get' })


//得到详细的商品属性 展示
export const reqAttrlist = (category1Id, category2Id, category3Id) => request({ url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`, method: 'get' })

//修改或者新创建商品属性 
//data的格式：
//   {"attrName": "string",
//   "attrValueList": [
//     {
//       "attrId": 0,
//
//       "valueName": "string"
//     }
//   ],
//   "categoryId": 0,
//   "categoryLevel": 0,
//   
// } 
export const reqAddOrUpdataAttr = (data) => request({ url: `/admin/product/saveAttrInfo`, data, method: 'post' })